# import requests
#
# # 请求百度首页，并返回响应结果
# response = requests.get("https://www.baidu.com/")
#
# # 打印响应码以及响应数据
# print(response.status_code) # 200
# print(response.text) # 得到的时百度首页这个页面所对应的html代码
#
#
# getResponse = requests.get(url="https://www.baidu.com/")
# postResponse = requests.post(url="https://www.baidu.com/")
# requestsGetResponse = requests.request(method="get", url="https://www.baidu.com/")
# requestsPostResponse = requests.request(method="post", url="https://www.baidu.com/")
#
# print(getResponse)
# print(postResponse)
# print(requestsGetResponse)
# print(requestsPostResponse)
#
#
# # 访问博客详情页接口
# # 添加用户登录凭证-user_token_header
# headers = {
#     "user_token_header": "eyJhbGciOiJIUzI1NiJ9.eyJpZCI6MSwidXNlck5hbWUiOiJ6aGFuZ3NhbiIsImV4cCI6MTc1NjYyNjU4MX0.zW18NXpxzByCNUeesMihU5HjRV67bAnuaerXb8I9XNM"
# }
# response = requests.get(url="http://8.137.19.140:9090/user/getAuthorInfo?blogId=158477", headers=headers)
# print(response.status_code)
# print(response.json())
#
#
# 访问博客登录接口
# 添加请求体数据
# data = {
#     "username": "zhangsan",
#     "password": 123456
# }
# response = requests.post(url="http://8.137.19.140:9090/user/login",data=data)
# print(response.json())
#
#
# # 访问个人博客系统
# json = {
#     "userName": "zhangsan",
#     "password": 123456
# }
# response = requests.post(url="http://134.175.206.246:8080/user/login", json=json)
# print(response.json())
#
# # 获取博客列表信息
# # JSESSIONID=49E49DA6366F4ABF68B96EC29299C2CE 是cookie信息的键值对形式
# # 该键值对使用 "=" 进行分隔，= 前面的为键，= 后面的为值
# cookies = {
#     "JSESSIONID": "49E49DA6366F4ABF68B96EC29299C2CE"
# }
# response = requests.get(url="http://134.175.206.246:8080/blog/getBlog", cookies=cookies)
# print(response.json())